@import './atom.scss';
@import './variable.scss';
@import './element.scss';


@font-face {
  font-family: "PingFang SC";
  src: url("../font/PingFangSC-Regular.ttf");
}

@font-face {
  font-family: "Source Han Sans CN";
  src: url("../font/SourceHanSansCN-VF.otf");
}

// 添加楷体和仿宋字体定义
@font-face {
  font-family: "KaiTi_GB2312";
  src: local("楷体_GB2312"), local("KaiTi"), local("楷体");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "FangSong_GB2312";
  src: local("仿宋_GB2312"), local("FangSong"), local("仿宋");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "SimHei";
  src: local("黑体"), local("SimHei"), local("Microsoft YaHei");
  font-weight: normal;
  font-style: normal;
}

* {
  margin: 0;
  padding: 0;
  font-family: PingFang SC;
  box-sizing: border-box;
}

// 全局滚动条样式
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f0f7ff;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: #b8d1e1;
  border-radius: 3px;
  
  &:hover {
    background: #93b8cc;
  }
}

// 全局过渡效果
* {
  transition: all 0.3s ease;
}

// 全局阴影效果
.shadow-sm {
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.shadow {
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.shadow-md {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.shadow-lg {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}


// Markdown 内容容器中的列表样式（如果需要）
.chat-content {

  // white-space: pre;
  ul {
    list-style-type: disc;
    margin: 1em 0;
    padding-left: 2em;

    ul {
      list-style-type: circle;
      margin: 0.5em 0;

      ul {
        list-style-type: square;
      }
    }
  }

  // 有序列表样式
  ol {
    list-style-type: decimal;
    margin: 1em 0;
    padding-left: 2em;

    ol {
      list-style-type: lower-alpha;
      margin: 0.5em 0;

      ol {
        list-style-type: lower-roman;
      }
    }
  }

  // 列表项样式
  li {
    margin: 0.5em 0;
    line-height: 1.5;
  }

  ul,
  ol {
    color: #333;
  }

  li {
    p {
      margin: 0;
    }
  }
}


.rich-text {
  color: #333;
  line-height: 1.6;
  font-size: 16px;

  // 标题样式
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    margin: 1.5em 0 0.8em;
    font-weight: 600;
    line-height: 1.4;
  }

  h1 {
    font-size: 2em;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.3em;
  }

  h2 {
    font-size: 1.75em;
  }

  h3 {
    font-size: 1.5em;
  }

  h4 {
    font-size: 1.25em;
  }

  // 段落样式
  p {
    margin: 1em 0;
    line-height: 1.8;
  }

  // 列表样式
  ul,
  ol {
    margin: 1em 0;
    padding-left: 2em;

    li {
      margin: 0.5em 0;
      line-height: 1.6;
    }
  }

  ul {
    list-style-type: disc;

    ul {
      list-style-type: circle;

      ul {
        list-style-type: square;
      }
    }
  }

  ol {
    list-style-type: decimal;

    ol {
      list-style-type: lower-alpha;

      ol {
        list-style-type: lower-roman;
      }
    }
  }

  // 表格样式
  table {
    width: 100%;
    margin: 1em 0;
    border-collapse: collapse;
    border-spacing: 0;
    overflow: auto;

    th,
    td {
      padding: 0.75em;
      border: 1px solid #e0e0e0;
      text-align: left;
    }

    th {
      font-weight: 600;
      background-color: #f5f7fa;
    }

    tr:nth-child(even) {
      background-color: #fafafa;
    }

    tr:hover {
      background-color: #f5f5f5;
    }
  }

  // 链接样式
  a {
    color: #409eff;
    text-decoration: none;
    transition: color 0.3s ease;

    &:hover {
      color: #66b1ff;
      text-decoration: underline;
    }
  }

  // 引用样式
  blockquote {
    margin: 1em 0;
    padding: 0.5em 1em;
    color: #666;
    background-color: #f8f9fa;
    border-left: 4px solid #409eff;
    font-style: italic;

    p {
      margin: 0.5em 0;
    }
  }

  // 代码样式
  code {
    padding: 0.2em 0.4em;
    margin: 0 0.2em;
    font-size: 0.9em;
    background-color: #f5f7fa;
    border-radius: 3px;
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
  }

  pre {
    margin: 1em 0;
    padding: 1em;
    background-color: #f5f7fa;
    border-radius: 4px;
    overflow: auto;

    code {
      padding: 0;
      margin: 0;
      background-color: transparent;
    }
  }

  // 图片样式
  img {
    max-width: 100%;
    height: auto;
    margin: 1em 0;
    border-radius: 4px;
  }

  // 分割线样式
  hr {
    margin: 2em 0;
    border: 0;
    border-top: 1px solid #eee;
  }

  // 强调样式
  strong {
    font-weight: 600;
  }

  em {
    font-style: italic;
  }

  // 删除线样式
  del {
    text-decoration: line-through;
    color: #999;
  }

  // 标记样式
  mark {
    background-color: #fff8e1;
    padding: 0.2em;
    border-radius: 2px;
  }

  // 上标和下标
  sub,
  sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
  }

  sup {
    top: -0.5em;
  }

  sub {
    bottom: -0.25em;
  }
}

// 聊天文件列表样式
.chat-file,
.session-input-box {
  width: 100%;
  margin: 10px 0;

  .el-scrollbar {
    .el-scrollbar__wrap {
      overflow-x: auto !important;
      overflow-y: hidden !important;
    }

    .el-scrollbar__bar.is-horizontal {
      height: 6px;
    }
  }

  .file-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    padding: 10px;
    // 设置最小宽度，确保内容超出时可以滚动
    min-width: min-content;
  }

  .chat-file-item {
    min-width: 200px;
    padding: 10px;
    background: #f5f7fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;

    &:hover {
      background: #ecf5ff;
      border-color: #409eff;
    }

    .chat-file-item-icon {
      margin-right: 10px;

      .icon-img {
        width: 32px;
        height: 32px;
        object-fit: contain;
      }
    }

    .chat-file-item-info {
      flex: 1;
      min-width: 0;

      .chat-file-item-name {
        font-size: 14px;
        color: #333;
        margin-bottom: 4px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .chat-file-item-size {
        font-size: 12px;
        color: #999;
      }
    }
  }
}


.chat {
  .md-editor {
    background: transparent !important;



    .md-editor-preview-wrapper {
      background: transparent !important;
      border-radius: 12px 12px 12px 12px;
      border: 1px solid #FFFFFF;

      box-sizing: border-box;
      padding: 16px;
      padding-top: 0;
    }
  }
}


.scene-tool {


  .el-collapse {
    border: none !important;
  }

  .el-collapse-item__header {
    border-bottom: none !important;
  }

  .el-collapse-item__wrap {
    border-bottom: none !important;
  }

  .el-collapse-icon-position-right .el-collapse-item__header {
    padding-right: 0 !important;
  }
}

.paper-value {


  #w-e-textarea-1 {
    padding: 0 !important;
  }

  .w-e-text-container {
    padding: 0 !important;
  }

}


.paper-value {
  h1 {
    font-family: "SimHei", "黑体", "Microsoft YaHei", sans-serif !important;
    font-size: 16pt !important; // 三号字体约等于16pt
    font-weight: bold !important;
    margin: 1.5em 0 0.8em 0;
    line-height: 1.4 !important;

  }

  h2 {
    font-family: "KaiTi_GB2312", "楷体", "KaiTi", serif !important;
    font-size: 16pt !important; // 三号字体
    font-weight: bold !important;
    margin: 1.2em 0 0.6em 0;
    line-height: 1.4 !important;

  }

  h3 {
    font-family: "FangSong_GB2312", "仿宋", "FangSong", serif !important;
    font-size: 16pt !important; // 三号字体
    font-weight: bold !important;
    margin: 1em 0 0.5em 0;
    line-height: 1.4 !important;

  }

  h4 {
    font-family: "FangSong_GB2312", "仿宋", "FangSong", serif !important;
    font-size: 16pt !important; // 三号字体
    font-weight: normal !important;
    margin: 0.8em 0 0.4em 0;
    line-height: 1.4 !important;

  }

  div,
  p {
    font-family: "FangSong_GB2312", "仿宋", "FangSong", serif !important;
    font-size: 16pt !important; // 三号字体
    font-weight: normal !important;
    line-height: 28pt !important; // 行距28磅
  }

  strong {
    font-weight: bold !important;
  }
}

.ai-input-hint {
  .el-popover.el-popper {
    padding: 0 !important;
  }
}
